{template header}

    {template title}

    <div class="box">
        <form method="post" action="{$this->url($c, 'save', array('type' => $this->type) )}">
        <table cellpadding="1" cellspacing="1" width="100%" border="0">
        <!--{if $this->type == 'basic'}-->
            <tr>
                <td width="25%">网站地址：</td>
                <td class="td2">
                    <input name="setting[weburl]" type="text" value="{$this->setting['weburl']}" />
                    <span class="lable">留空系统自动获取</span>
                </td>
            </tr>
            <tr>
                <td>网站名称：</td>
                <td class="td2">
                    <input name="setting[webname]" type="text" value="{$this->setting['webname']}" />
                </td>
            </tr>
            <tr>
                <td>网站标题：</td>
                <td class="td2"><input type="text" name="setting[webtitle]" value="{$this->setting['webtitle']}" /></td>
            </tr>
            <tr>
                <td>网站副标题：</td>
                <td class="td2"><input type="text" name="setting[webtitle2]" value="{$this->setting['webtitle2']}" /></td>
            </tr>
            <tr>
                <td>ICP备案号：</td>
                <td class="td2">
                    <input name="setting[webicp]" type="text" value="{$this->setting['webicp']}" />
                </td>
            </tr>

            <tr>
                <td>网站描述：</td>
                <td class="td2"><textarea name="setting[webdesc]">{$this->setting['webdesc']}</textarea>
                </td>
            </tr>
            <tr>
                <td>网站关键词：</td>
                <td class="td2"><textarea name="setting[webkey]">{$this->setting['webkey']}</textarea>
                </td>
            </tr>

            <tr>
                <td>网站底部信息：</td>
                <td class="td2"><textarea name="setting[webcopyright]">{$this->setting['webcopyright']}</textarea>
                </td>
            </tr>
            <tr>
                <td>网站关闭原因：</td>
                <td class="td2"><textarea name="setting[close_msg]">{$this->setting['close_msg']}</textarea>
                </td>
            </tr>
        <!--{/if}-->
        <!--{if $this->type == 'close'}-->
            <tr>
                <td width="25%">关闭网站：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_close]" value="1"{$this->setting['is_close'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>关闭注册：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_reg]" value="1"{$this->setting['is_reg'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>显示运行信息：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_debug]" value="1"{$this->setting['is_debug'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>启用GZIP：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_gzip]" value="1"{$this->setting['is_gzip'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>压缩源代码：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_formathtml]" value="1"{$this->setting['is_formathtml'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>启用验证码：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_code]" value="1"{$this->setting['is_code'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>启用伪静态：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_rewrite]" value="1"{$this->setting['is_rewrite'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>启用WAP：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_wap]" value="1"{$this->setting['is_wap'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>禁止评论：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_comment]" value="1"{$this->setting['is_comment'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>评论需要审核：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_comment_audit]" value="1"{$this->setting['is_comment_audit'] ? ' checked' : ''} />
                </td>
            </tr>
            <tr>
                <td>新评论邮件通知：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[is_comment_email]" value="1"{$this->setting['is_comment_email'] ? ' checked' : ''} />
                </td>
            </tr>
        <!--{/if}-->
        <!--{if $this->type == 'core'}-->
            <tr>
                <td width="25%">默认主题：</td>
                <td class="td2">
                    <select name="setting[Theme]">
                    <!--{if $themes = list_dir(APP_PATH . "/themes/front/*")}-->
                        <!--{loop $themes $v}-->
                        <option value="{$v}"{$this->setting['Theme'] == $v ? ' selected' : ''}>{$v}</option>
                        <!--{/loop}-->
                        <option value="random"{$this->setting['Theme'] == 'random' ? ' selected' : ''}>随机</option>
                    <!--{/if}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td>系统缓存有效期：</td>
                <td class="td2">
                    <input name="setting[cache_time]" type="text" class="span1 isint" value="{$this->setting['cache_time']}" />
                    <span class="lable">小时</span>
                </td>
            </tr>
            <tr>
                <td>后台登录有效期：</td>
                <td class="td2">
                    <input name="setting[cookie_time]" type="text" class="span1 isint" value="{$this->setting['cookie_time']}" />
                    <span class="lable">天</span>
                </td>
            </tr>
            <tr>
                <td>默认时区：</td>
                <td class="td2">
                    <select name="setting[timezone]">
                        <!--{if $timezone = $this->get_time_zone()}-->
                        <!--{loop $timezone $k $v}-->
                        <option value="{$k}"{echo (!empty($setting['timezone']) ? $setting['timezone'] : 'Asia/Brunei') == $k ? ' selected' : ''}>{$v}</option>
                        <!--{/loop}-->
                        <!--{/if}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td>时间格式：</td>
                <td class="td2">
                    <select name="setting[timeformat]" style="width: 170px;">
                        <!--{if $timeformat = $this->get_time_style()}-->
                        <!--{loop $timeformat $k $v}-->
                        <option value="{$k}"{echo (!empty($setting['timeformat']) ? $setting['timeformat'] : 'Y-m-d H:i:s') == $k ? ' selected' : ''}>{$v}</option>
                        <!--{/loop}-->
                        <!--{/if}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td>摘要字数：</td>
                <td class="td2">
                    <input name="setting[excerpt_num]" type="text" class="span1 isint" value="{$this->setting['excerpt_num']}" />
                </td>
            </tr>
            <tr>
                <td>每页文章数量：</td>
                <td class="td2">
                    <input name="setting[article_num]" type="text" class="span1 isint" value="{$this->setting['article_num']}" />
                </td>
            </tr>
            <tr>
                <td>相关文章数量：</td>
                <td class="td2">
                    <input name="setting[related_num]" type="text" class="span1 isint" value="{$this->setting['related_num']}" />
                </td>
            </tr>
            <tr>
                <td>侧栏标签数量：</td>
                <td class="td2">
                    <input name="setting[tag_num]" type="text" class="span1 isint" value="{$this->setting['tag_num']}" />
                </td>
            </tr>
            <tr>
                <td>侧栏评论数量：</td>
                <td class="td2">
                    <input name="setting[comment_num]" type="text" class="span1 isint" value="{$this->setting['comment_num']}" />
                </td>
            </tr>
            <tr>
                <td>上传目录格式：</td>
                <td class="td2">
                    <select name="setting[updir]">
                        <!--{loop $this->get_upload_style() $k $v}-->
                        <option value="{$k}"{echo (!empty($setting['updir']) ? $setting['updir'] : 'ymd') == $k ?' selected' : ''}>{$v}</option>
                        <!--{/loop}-->
                    </select>
                </td>
            </tr>
            <tr>
                <td>允许上传的文件类型：</td>
                <td class="td2">
                    <input name="setting[uptype]" type="text" class="span4" value="{$this->setting['uptype']}" />
                    <span class="lable">留空不限制，格式: '*.jpg;'</span>
                </td>
            </tr>
            <tr>
                <td>允许上传的文件大小：</td>
                <td class="td2">
                    <input name="setting[upsize]" type="text" class="span1 isint" value="{$this->setting['upsize']}" /> MB
                </td>
            </tr>
        <!--{/if}-->
        <!--{if $this->type == 'rewrite'}-->

            <tr>
                <td width="25%">文章内容页：</td>
                <td class="td2">
                    <input type="text" name="rewrite[archives]" class="required" value="{$this->setting['rewrite']['archives']}" />
                    <span class="lable">变量: $id,$y,$m,$d</span>
                </td>
            </tr>
            <tr>
                <td width="25%">文章栏目页：</td>
                <td class="td2">
                    <input type="text" name="rewrite[sort]" class="required" value="{$this->setting['rewrite']['sort']}" />
                    <span class="lable">变量: $id,$alias</span>
                </td>
            </tr>
            <tr>
                <td width="25%">标签页：</td>
                <td class="td2">
                    <input type="text" name="rewrite[tag]" class="required" value="{$this->setting['rewrite']['tag']}" />
                    <span class="lable">变量: $tag</span>
                </td>
            </tr>
            <tr>
                <td width="25%">搜索页：</td>
                <td class="td2">
                    <input type="text" name="rewrite[search]" class="required" value="{$this->setting['rewrite']['search']}" />
                    <span class="lable">变量: $key</span>
                </td>
            </tr>
            <tr>
                <td width="25%">后缀名：</td>
                <td class="td2">
                    <input type="text" name="setting[rewrite_suffix]" class="required span1" value="{$this->setting['rewrite_suffix']}" />
                </td>
            </tr>
            <tr>
                <td width="25%">分页分隔符：</td>
                <td class="td2">
                    <input type="text" name="setting[rewrite_sep]" class="required span1" value="{$this->setting['rewrite_sep']}" />
                </td>
            </tr>
            <tr>
                <td width="25%">启用301跳转：</td>
                <td class="td2">
                    <input type="checkbox" name="setting[rewrite_301]" value="1"{$this->setting['rewrite_301'] ? ' checked' : ''} />
                </td>
            </tr>
        <!--{/if}-->
            <tr>
                <td colspan="2" class="td3">
                    <a title="保存设置" class="btn btn-success setting" href="{$this->url($c, null, array('type' => $this->type) )}">保存</a>
                </td>
            </tr>
            <script type="text/javascript">
                $( ".setting" ).click( function () {
                    var obj = $( this );
                    $( ":checkbox" ).each( function () {
                        if ( !this.checked ) {
                            $( this ).val( 0 );
                            $( this ).attr( 'checked', true );
                        }
                    });
                    ajaxPOST( obj );
                    return false;
                });
            </script>
        </table>
        </form>
    </div>
{template footer}